package edu.stu.software.family.RabbitMQ;

import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
public class MQContUtils {
	/**
	 * 
	 * @author jing_huan_ming
	 *
	 */
       public static Connection getConnection() throws Exception {
        //create factiry
        ConnectionFactory factory = new ConnectionFactory();
        //connect ip
        factory.setUsername("guest");
        factory.setPassword("guest");
        factory.setHost("localhost");
        factory.setVirtualHost("/"); 
        factory.setPort(5672);
        Connection connection = factory.newConnection();
        return connection;
    }
}
